package com.qf.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.qf.entity.dto.GoodsType;
import com.qf.mapper.GoodsTypeMapper;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
public class GoodsTypeService extends ServiceImpl<GoodsTypeMapper,GoodsType> {
    @Transactional(readOnly = true)
    public List<GoodsType> getAllByDesc() {
        QueryWrapper<GoodsType> wrapper = new QueryWrapper<>();
        wrapper.lambda().orderByDesc(GoodsType::getOrderNum);
        return this.list(wrapper);
    }
}
